﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/SiteManage.Master" AutoEventWireup="true" CodeBehind="ChiTietHoaDon.aspx.cs" Inherits="NXBSaiGon.Admin.ChiTietHoaDon" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div style="text-align:center">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="MaHD,MaSach" 
        DataSourceID="SqlDataSource1" 
        EmptyDataText="There are no data records to display." ForeColor="#333333" 
        GridLines="None" PageSize="5" Width="599px">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="MaHD" HeaderText="MaHD" ReadOnly="True" 
                SortExpression="MaHD" />
            <asp:BoundField DataField="MaSach" HeaderText="MaSach" ReadOnly="True" 
                SortExpression="MaSach" />
            <asp:BoundField DataField="DonGia" HeaderText="DonGia" 
                SortExpression="DonGia" />
            <asp:BoundField DataField="SoLuong" HeaderText="SoLuong" 
                SortExpression="SoLuong" />
            <asp:BoundField DataField="TongGia" HeaderText="TongGia" 
                SortExpression="TongGia" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
        </Columns>
        <EditRowStyle BackColor="#7C6F57" />
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#E3EAEB" />
        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F8FAFA" />
        <SortedAscendingHeaderStyle BackColor="#246B61" />
        <SortedDescendingCellStyle BackColor="#D4DFE1" />
        <SortedDescendingHeaderStyle BackColor="#15524A" />
    </asp:GridView>
</div>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:NXBSaiGonConnectionString1 %>" 
        DeleteCommand="DELETE FROM [ChiTietHoaDon] WHERE [MaHD] = @MaHD AND [MaSach] = @MaSach" 
        InsertCommand="INSERT INTO [ChiTietHoaDon] ([MaHD], [MaSach], [DonGia], [SoLuong], [TongGia]) VALUES (@MaHD, @MaSach, @DonGia, @SoLuong, @TongGia)" 
        ProviderName="<%$ ConnectionStrings:NXBSaiGonConnectionString1.ProviderName %>" 
        SelectCommand="SELECT [MaHD], [MaSach], [DonGia], [SoLuong], [TongGia] FROM [ChiTietHoaDon] WHERE MaHD = @MaHD" 
        UpdateCommand="UPDATE [ChiTietHoaDon] SET [DonGia] = @DonGia, [SoLuong] = @SoLuong, [TongGia] = @TongGia WHERE [MaHD] = @MaHD AND [MaSach] = @MaSach">
        <SelectParameters>
            <asp:QueryStringParameter QueryStringField="MaHD" Name="MaHD" Type="Int32" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="MaHD" Type="Int32" />
            <asp:Parameter Name="MaSach" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="MaHD" Type="Int32" />
            <asp:Parameter Name="MaSach" Type="Int32" />
            <asp:Parameter Name="DonGia" Type="Decimal" />
            <asp:Parameter Name="SoLuong" Type="Int32" />
            <asp:Parameter Name="TongGia" Type="Decimal" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="DonGia" Type="Decimal" />
            <asp:Parameter Name="SoLuong" Type="Int32" />
            <asp:Parameter Name="TongGia" Type="Decimal" />
            <asp:Parameter Name="MaHD" Type="Int32" />
            <asp:Parameter Name="MaSach" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>
